#include"skippred.h"
#include<vector>
#include<list>
#include<iostream>
#include<fstream>

using std::vector;
using std::list;
using std::cin;
using std::cout;
using std::endl;

class isOdd {
	int rem;
	public:
	isOdd(int m) : rem(m) {}
	bool operator()(int n) {
		return ((n % 2) == rem);
	}
} odd(1) , even(0);

int main() {
	vector<int> v;
	list<int> l;
	std::ifstream in("./infile");
	int i;
	while ( in.good()) {
		in >> i;
		v . push_back(i);
		l . push_back(i);
	}
	skipIterator<vector<int>::iterator, isOdd> itV ( v . begin(), v . end(), odd);
	skipIterator<list<int>::iterator, isOdd> itL ( l . begin(), l . end(), even);
	
	for ( ; itV != v . end(); ++itV)
		cout << *itV << " ";
	cout << endl;
	
	for ( ; itL != l . end(); ++itL)
		cout << *itL << " ";
	cout << endl;
	
	return 0;
}